<template>
<div class="content">
  <div class="point-main-content">
    <!-- 建点情况 -->
    <div class="module">
      <div class="common-head">
        <div class="common-sub-title">
          <img src="~assets/img/icon_data.png" alt="量碰统计">
          <span>建点情况</span>
          <router-link tag="div" to="/see_point_rule" class="point-rule"><span>活动规则</span><img src="~assets/img/icon_detail.png" alt="规则"></router-link>
        </div>
      </div>
      <div class="module-list module-long-border">
        <div class="common-item ">
          <div><span>已完成建点：</span><span class="num" v-text="seen_points+'个'"></span></div>
          <!-- <div><span>剩余可建点：</span><span class="num" v-text="seeing_points+'个'"></span></div> -->
          <div><span>单点奖励：</span><span class="num" v-text="point_bonus+'元'"></span></div>
        </div>
      </div>
    </div>
    <!-- 建点奖励  -->
    <div class="module">
      <div class="common-head">
        <div class="common-sub-title">
          <img src="~assets/img/icon_info.png" alt="培育统计">
          <span>建点奖励</span>
        </div>
      </div>
      <div class="prize common-item">
        <div class="item"><span>已获得奖励金额：</span><span class="num" v-text="get_bonus+'元'"></span></div>
        <div class="item"><span>预计：</span><span class="num" v-text="pre_bonus+'元'"></span></div>
      </div>
    </div>
  </div>
</div>
</template>

<script>
import { apiPost } from 'src/common/api.js'
export default {
  data () {
    return {
      seen_points: 0,
      seeing_points: 0,
      point_bonus: 0,
      get_bonus: 0,
      pre_bonus: 0
    }
  },
  mounted () {
    this.getInfo()
  },
  methods: {
    // 获取建点信息
    getInfo () {
      apiPost('see_point',
        {}).then((res) => {
        if (res.status === 0) {
          let data = res.data
          // console.log(data)
          this.seen_points = data.seen_points
          this.seeing_points = data.seeing_points
          this.point_bonus = data.point_bonus
          this.get_bonus = data.get_bonus
          this.pre_bonus = data.pre_bonus
        } else {
          console.log(res.msg)
        }
      })
    }
  }
}
</script>

<style scoped lang='scss'>
  @import '~lib/reset.scss';
  .common-item {
    padding: 16px 0 16px 0;
    font-size: $font-15;
    border-bottom: 1px solid #e5e5e5;
    span {
      line-height: 2;
      letter-spacing: 2px;
    }
    .num {
      color: $color-font-two;
    }
  }
  .point-main-content {
    margin-top: 10px;
    .module {
      background-color: #fff;
    }
    .common-head {
      padding: 0 16px;
      .common-sub-title {
        .point-rule {
          float: right;
          span {
            font-size: $font-15;
          }
          img {
            width: 24px;
            margin-left: 10px;
          }
        }
      }
    }
    .module-list {
      padding:0 16px 0 16px;
      .more {
        float: right;
        span {
          vertical-align: middle;
            img {
            height: 12px;
            margin-left: 10px;
          }
        }
      }
    }
    .module-long-border {
      border-bottom: 1px solid #e5e5e5;
      div:last-child {
        border-bottom: none;
      }
    }
    .module {
      background: #fff;
      margin: 10px auto auto auto;
      .item {
        padding: 0 16px;
      }
    }
  }
</style>
